# 判断是不是素数的函数
def isPrime(n):
    for i in range(2,int(n/2)+1):
        if n % i ==0:
            return False
    return True

# 判断是不是回文数 
def hui(n):
    s = 0
    t = n
    while n>0:
        s = s * 10 + (n % 10)
        n = n // 10
    return s == t

for i in range(100,1000):
    if isPrime(i) and hui(i):
        print(i)
        
        